package org.openrisk.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Entity
public class Address extends Base {

	private static final long serialVersionUID = -8672073511152636370L;

	@Column(nullable=false, length=50)
	@NotNull
	private String streetName;
	
	@Min(value=1)
	@NotNull
	private Integer houseNumber;
	
	@Column(nullable=true, length=50)
	private String houseNumberAddition;
	
	@Column(nullable=false, length=10)
	@NotNull
	private String postalCode;
	
	@Column(nullable=false, length=50)
	@NotNull
	private String cityName;
	
	@Column(nullable=false, length=2)
	@NotNull
	private String countryIsoCode;

	/**
	 * @return the streetName
	 */
	public String getStreetName() {
		return streetName;
	}

	/**
	 * @param streetName the streetName to set
	 */
	public void setStreetName(String streetName) {
		this.streetName = streetName;
	}

	/**
	 * @return the houseNumber
	 */
	public Integer getHouseNumber() {
		return houseNumber;
	}

	/**
	 * @param houseNumber the houseNumber to set
	 */
	public void setHouseNumber(Integer houseNumber) {
		this.houseNumber = houseNumber;
	}

	/**
	 * @return the houseNumberAddition
	 */
	public String getHouseNumberAddition() {
		return houseNumberAddition;
	}

	/**
	 * @param houseNumberAddition the houseNumberAddition to set
	 */
	public void setHouseNumberAddition(String houseNumberAddition) {
		this.houseNumberAddition = houseNumberAddition;
	}

	/**
	 * @return the postalCode
	 */
	public String getPostalCode() {
		return postalCode;
	}

	/**
	 * @param postalCode the postalCode to set
	 */
	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	/**
	 * @return the cityName
	 */
	public String getCityName() {
		return cityName;
	}

	/**
	 * @param cityName the cityName to set
	 */
	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	/**
	 * @return the countryIsoCode
	 */
	public String getCountryIsoCode() {
		return countryIsoCode;
	}

	/**
	 * @param countryIsoCode the countryIsoCode to set
	 */
	public void setCountryIsoCode(String countryIsoCode) {
		this.countryIsoCode = countryIsoCode;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Address [streetName=" + streetName + ", houseNumber="
				+ houseNumber + ", houseNumberAddition=" + houseNumberAddition
				+ ", postalCode=" + postalCode + ", cityName=" + cityName
				+ ", countryIsoCode=" + countryIsoCode + "] --> " + super.toString();
	}
	
}
